<html>
<head><meta charset="utf-8"><title>How do I get compiletest to pass --extern for a dependency? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20get.20compiletest.20to.20pass.20--extern.20for.20a.20dependency.3F.html">How do I get compiletest to pass --extern for a dependency?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="232696119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20get%20compiletest%20to%20pass%20--extern%20for%20a%20dependency%3F/near/232696119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20get.20compiletest.20to.20pass.20--extern.20for.20a.20dependency.3F.html#232696119">(Apr 01 2021 at 02:49)</a>:</h4>
<p>I tried <code>aux-build</code>, but that only passes <code>-L</code>. Currently I'm doing it with this awful hack:</p>
<div class="codehilite"><pre><span></span><code>// compile-flags:--extern panic_item={{build-base}}/unused-extern-crate/libpanic_item.so
</code></pre></div>
<p>but I'd prefer to have something more "official", since this test will silently pass if that filename is wrong :/</p>



<a name="232696183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20get%20compiletest%20to%20pass%20--extern%20for%20a%20dependency%3F/near/232696183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20get.20compiletest.20to.20pass.20--extern.20for.20a.20dependency.3F.html#232696183">(Apr 01 2021 at 02:50)</a>:</h4>
<p>oh yay it turns out that didn't actually work, probably because it's an .so and not an .rlib</p>



<a name="232696202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20get%20compiletest%20to%20pass%20--extern%20for%20a%20dependency%3F/near/232696202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20get.20compiletest.20to.20pass.20--extern.20for.20a.20dependency.3F.html#232696202">(Apr 01 2021 at 02:50)</a>:</h4>
<p>I guess I could just make this a run-make test</p>



<a name="232696321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20get%20compiletest%20to%20pass%20--extern%20for%20a%20dependency%3F/near/232696321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20get.20compiletest.20to.20pass.20--extern.20for.20a.20dependency.3F.html#232696321">(Apr 01 2021 at 02:53)</a>:</h4>
<p>yeah that worked well</p>



<a name="232706844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20get%20compiletest%20to%20pass%20--extern%20for%20a%20dependency%3F/near/232706844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20get.20compiletest.20to.20pass.20--extern.20for.20a.20dependency.3F.html#232706844">(Apr 01 2021 at 05:35)</a>:</h4>
<p>There's a way to do this with an annotation, but it's not <code>aux-build</code>.</p>



<a name="232706913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20get%20compiletest%20to%20pass%20--extern%20for%20a%20dependency%3F/near/232706913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20get.20compiletest.20to.20pass.20--extern.20for.20a.20dependency.3F.html#232706913">(Apr 01 2021 at 05:36)</a>:</h4>
<p>I don't remember the name, but you can search compiletest for it. There are some tests in the UI suite that are using it.</p>



<a name="232810939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20get%20compiletest%20to%20pass%20--extern%20for%20a%20dependency%3F/near/232810939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20get.20compiletest.20to.20pass.20--extern.20for.20a.20dependency.3F.html#232810939">(Apr 01 2021 at 19:22)</a>:</h4>
<p>It's <code>// aux-crate</code>.</p>



<a name="232903906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20get%20compiletest%20to%20pass%20--extern%20for%20a%20dependency%3F/near/232903906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20get.20compiletest.20to.20pass.20--extern.20for.20a.20dependency.3F.html#232903906">(Apr 02 2021 at 14:19)</a>:</h4>
<p>hmm, this gave a link error on windows for some reason: <a href="https://github.com/rust-lang/rust/pull/83738#issuecomment-812550404">https://github.com/rust-lang/rust/pull/83738#issuecomment-812550404</a></p>



<a name="232917276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20do%20I%20get%20compiletest%20to%20pass%20--extern%20for%20a%20dependency%3F/near/232917276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20do.20I.20get.20compiletest.20to.20pass.20--extern.20for.20a.20dependency.3F.html#232917276">(Apr 02 2021 at 16:11)</a>:</h4>
<p>I haven't looked at what you are doing, but I believe aux crates are dynamically linked by default, and need <code>// no-prefer-dynamic</code> to disable that.  May want to consider that.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>